/* 
 * File:   Stack.h
 * Author: gizmo
 *
 * Created on October 14, 2010, 1:29 PM
 */

#ifndef STACK_H
#define	STACK_H

#include "State.h"
#include <deque>
using namespace std;

class Stack {
public:
    Stack();
    Stack(const Stack& orig);
    virtual ~Stack();

    void push(const State& x);
    void pop();
    State& top();
    const State& top() const;
    bool empty() const;
    int size() const;
    int serialize(unsigned char * buffer, const int bufferSize);
    int deserialize(unsigned char * buffer, const int bufferSize, Graph * g);
    Stack divide(unsigned int maxCount = 1);

    /**
     * Maximum nodes that can be processed by this software.
     * Used to allocate temporary buffers when serializing stacks.
     */
    static const unsigned int MAX_STATE_SIZE = 30;

private:
    deque<State> representation;

};

#endif	/* STACK_H */

